package com.ddwl.gate.service;

import com.ddwl.common.util.UUIDGenerator;
import com.ddwl.gate.dao.BohuanCallRecordDao;
import com.ddwl.gate.model.BohuanCallRecord;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author hemiaojun
 * @Date 2020/10/14 14:23
 */
@Service
public class BohuanCallRecordService {

    @Resource
    private BohuanCallRecordDao bohuanCallRecordDao;

    public void add(BohuanCallRecord bcr) {
        bcr.setId(UUIDGenerator.getShortUUID());
        bohuanCallRecordDao.insert(bcr);
    }

    public BohuanCallRecord queryBySerialnoAndType(String serialno, Byte type) {
        BohuanCallRecord entity = new BohuanCallRecord();
        entity.setSerialno(serialno);
        entity.setCallType(type);
        return bohuanCallRecordDao.selectOne(entity);
    }

    public void changeRechargeRecordId(Map<String, String> map) {
        bohuanCallRecordDao.changeRechargeRecordId(map);
    }

    public List<BohuanCallRecord> getAll() {
        return bohuanCallRecordDao.getAll();
    }

    public void changeId(Map<String, String> map) {
        bohuanCallRecordDao.changeId(map);
    }
}
